package com.example.grpc.client.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;

@ConfigurationProperties(prefix = "grpc.client")
@Data
public class GrpcClientProperties {
    private Map<String, ServiceConfig> services = new HashMap<>();
    
    @Data
    public static class ServiceConfig {
        private String host = "localhost";
        private Integer port;
        private boolean plaintext = true;
        private long keepAliveTimeNanos = 30000;
        private long keepAliveTimeoutNanos = 5000;
        private boolean keepAliveWithoutCalls = false;
        private int maxInboundMessageSize = 1024 * 1024 * 4; // 4MB
    }
}